package ordena1;

public class InsertionSort {
	 
	public int valueSortInt[]= new int[90]; 

	public void insertion(int valor[], int pos){   
		int tmp;
	    boolean troca;

		valueSortInt[pos] = valor[pos];

		if (pos > 0) {
			do {
				if (valueSortInt[pos] < valueSortInt[pos - 1]) {
					troca = true;
					tmp = valueSortInt[pos];
					valueSortInt[pos] = valueSortInt[pos - 1];
					valueSortInt[pos - 1] = tmp;

					pos = pos - 1;
					if (pos == 0)
						troca = false;
				} else
					troca = false;
			} while (troca == false);
		}
	}

}
